package Homework7;

import java.util.*;

public class Homework7_2_TestHouseProperty {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        double area = input.nextDouble();
        double unitPrice = input.nextDouble();
        Residence residence = new Residence(area,unitPrice);
        calculateTaxes(residence);
        Shop shop = new Shop(area,unitPrice);
        calculateTaxes(shop);
        Villa villa = new Villa(area,unitPrice);
        calculateTaxes(villa);
        Office office = new Office(area,unitPrice);
        calculateTaxes(office);
    }
    public static void calculateTaxes(HouseProperty h){
        System.out.println(h.getClass().getSimpleName() + ": tax is "
                + h.taxCalculation());
    }
}
